-- 奖励界面  列表子项
local GuildWarAward1Cell = app.mvc.createListViewCell(...)
--data =
function GuildWarAward1Cell.create(node)
    local sprite = GuildWarAward1Cell.extend(node or cc.CSLoader:createNode(Res.CSGuildWarAward1Cell))
    if node == nil then
        ccui.Helper:doLayout(sprite)
    end
    sprite:init()
    return sprite
end


function GuildWarAward1Cell:init(data)
    self.super.init(self, data)
    self:setContentSize( self._ui.Panel:getContentSize() )
    self._ui.respond:addClickEventListener(function()
        if self._data then
            self:dispatchCellEvent("clickAward", self._data.minRank)
        end
    end)

    self:refresh()
end

function GuildWarAward1Cell:refresh()
    if not self._data then
        return
    end
    local guildData = self._data.guildData
    if guildData then
        self._ui.bg2:setVisible(true)
        self._ui.server:setString(guildData:getServerName().." "..guildData:getGuildName())
    else
        self._ui.bg2:setVisible(false)
        self._ui.server:setString("")
    end
end








return GuildWarAward1Cell